<template>
  <div>
    <el-form :model="formInline" label-width="80px">
       <el-form-item label="用户名">
        <el-input v-model.trim="formInline.Name" placeholder="用户名" :disabled="true"></el-input>
      </el-form-item>
      <el-form-item label="描述">
        <el-input v-model="formInline.Description" placeholder="描述" :disabled="true"></el-input>
      </el-form-item>
      <el-form-item label="排序">
        <el-input v-model.number="formInline.Sort" placeholder="排序" :disabled="true"></el-input>
      </el-form-item>
      <el-form-item class="viewdata_button">
        <el-button type="default" @click="ViewCancle">取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
import {mixinDetailMixed} from '@/mixedObject/detailMixed';
export default {
  mixins:[mixinDetailMixed],
  props: ["currentId", "random"],
  data() {
    return {
     
    };
  },
  watch: {
    random(newValue, oldValue) {
      //初始化表单
      this.InitFormInLine();
    }
  },
  created() {
        //初始化表单
      this.InitFormInLine();
  },
  methods: {
    //初始化
    InitFormInLine() {
      this.$store
        .dispatch("role/GetRoleInfo", {Id:this.currentId})
        .then(data => {
          this.formInline = {
            Id:this.currentId,
            Name: data.name,
            Description: data.description,
            Sort: data.sort,
          };
        });
    }
  }
};
</script>